package com.pt25.base.exception;


import com.pt25.base.res.ResCode;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 自定业务异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BizException extends RuntimeException{
    private Integer code;
    private String msg;

    public BizException() {
        msg = "系统内部异常";
    }

    public BizException(String msg) {
        this.code = ResCode.FAIL.getCode();
        this.msg = msg;
    }

    public BizException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BizException(ResCode ResCode) {
        this.code = ResCode.getCode();
        this.msg = ResCode.getMsg();
    }
}
